<!DOCTYPE html>
<html lang="zh_cn">
<head>
        <title>来玩魔王的咚</title>
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <meta charset="utf-8" />
        <!-- twitter card metadata -->
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="/images/mowang.png">
<meta name="twitter:site" content="">
<meta name="twitter:title" content="来玩魔王的咚">
<meta name="twitter:description" content="">
        <!-- OG Tags -->
<meta property="og:url" content=""/>
<meta property="og:title" content="来玩魔王的咚" />
<meta property="og:description" content="" />
        <!-- favicon -->
        <link rel="icon" type="image/png" href="/images/mowang.png">
        <!-- moment.js for date formatting -->
        <script src="/theme/js/moment.js"></script>
        <!-- css -->
        <link rel="stylesheet" type="text/css" href="/theme/css/main.css" />
        <!-- 左边的menu，如果页面高度不够，就跟着滚动，否则文章分类显示不全 -->
        <link rel="stylesheet" type="text/css" href="/theme/css/mycss/menu.css" />
		<script>
			
                /*! grunt-grunticon Stylesheet Loader - v2.1.2 | https://github.com/filamentgroup/grunticon | (c) 2015 Scott Jehl, Filament Group, Inc. | MIT license. */
    
    (function(e){function t(t,n,r,o){"use strict";function a(){for(var e,n=0;u.length>n;n++)u[n].href&&u[n].href.indexOf(t)>-1&&(e=!0);e?i.media=r||"all":setTimeout(a)}var i=e.document.createElement("link"),l=n||e.document.getElementsByTagName("script")[0],u=e.document.styleSheets;return i.rel="stylesheet",i.href=t,i.media="only x",i.onload=o||null,l.parentNode.insertBefore(i,l),a(),i}var n=function(r,o){"use strict";if(r&&3===r.length){var a=e.navigator,i=e.Image,l=!(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect||!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")||e.opera&&-1===a.userAgent.indexOf("Chrome")||-1!==a.userAgent.indexOf("Series40")),u=new i;u.onerror=function(){n.method="png",n.href=r[2],t(r[2])},u.onload=function(){var e=1===u.width&&1===u.height,a=r[e&&l?0:e?1:2];n.method=e&&l?"svg":e?"datapng":"png",n.href=a,t(a,null,null,o)},u.src="",document.documentElement.className+=" grunticon"}};n.loadCSS=t,e.grunticon=n})(this);(function(e,t){"use strict";var n=t.document,r="grunticon:",o=function(e){if(n.attachEvent?"complete"===n.readyState:"loading"!==n.readyState)e();else{var t=!1;n.addEventListener("readystatechange",function(){t||(t=!0,e())},!1)}},a=function(e){return t.document.querySelector('link[href$="'+e+'"]')},c=function(e){var t,n,o,a,c,i,u={};if(t=e.sheet,!t)return u;n=t.cssRules?t.cssRules:t.rules;for(var l=0;n.length>l;l++)o=n[l].cssText,a=r+n[l].selectorText,c=o.split(");")[0].match(/US\-ASCII\,([^"']+)/),c&&c[1]&&(i=decodeURIComponent(c[1]),u[a]=i);return u},i=function(e){var t,o,a;o="data-grunticon-embed";for(var c in e)if(a=c.slice(r.length),t=n.querySelectorAll(a+"["+o+"]"),t.length)for(var i=0;t.length>i;i++)t[i].innerHTML=e[c],t[i].style.backgroundImage="none",t[i].removeAttribute(o);return t},u=function(t){"svg"===e.method&&o(function(){i(c(a(e.href))),"function"==typeof t&&t()})};e.embedIcons=i,e.getCSS=a,e.getIcons=c,e.ready=o,e.svgLoadedCallback=u,e.embedSVG=u})(grunticon,this);
                
                grunticon(["/theme/css/icons.data.svg.css", "/theme/css/icons.data.png.css", "/theme/css/icons.fallback.css"]);
            </script>
        <noscript><link href="/theme/css/icons.fallback.css" rel="stylesheet"></noscript>
        <!-- menu toggle javascript -->
        <script type="text/javascript">
            document.addEventListener("DOMContentLoaded", initMenu);
            
            function initMenu(){
                var menu = document.getElementById("menu");
                var menulink = document.getElementById("menu-link");
                menulink.addEventListener("click", function toggleMenu(){
                        window.event.preventDefault();
                        menulink.classList.toggle('active');
                        menu.classList.toggle('active');              
                    });
            };
        </script>
        <!-- 不蒜子 -->
        <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
</head>
<body>
    <div role="banner" id="masthead">
        <header>
            <a href="/"><img src="/images/mowang.png" alt="McManus Logo"></a>
                <h1>来玩魔王的咚@骑士救兵</h1>
            <a href="#menu" id="menu-link">more stuff</a>
            <nav id="menu">
                <ul>
                        <li><a href="/tags">tags</a></li>
                            <li><a href="/category/cloud.html">Cloud</a></li>
                            <li><a href="/category/docker.html">Docker</a></li>
                            <li><a href="/category/go.html">Go</a></li>
                            <li><a href="/category/linux.html">Linux</a></li>
                            <li><a href="/category/python.html">Python</a></li>
                            <li><a href="/category/xue-xi-bi-ji.html">学习笔记</a></li>
                            <li><a href="/category/yun-wei-zi-dong-hua.html">运维自动化</a></li>
                </ul>
            </nav>
        </header>
    </div>
        <div class="page" role="main">
<div class="articles">
<p class="paginator">
        <a href="/index5.html" class="previous">&laquo;</a>
    <span>
        <a href="/index.html">首页</a>
        &nbsp;6 / 9&nbsp;
        <a href="/index9.html">尾页</a>
    </span>
        <a href="/index7.html" class="next">&raquo;</a>
</p>
    <ol>
        <li>
            <article>
                <footer>
                        <p>
                        <time datetime="2020-08-13 17:00:00+08:00">
                            <script>document.write(moment('2020-08-13 17:00:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                        ~
                        <time datetime="2020-08-13 17:00:00+08:00">
                            <script>document.write(moment('2020-08-13 17:00:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                                in <a href="/category/go.html"><span class="category-tag">Go</span></a>
                    </p>
                </footer>
                <header>
                    <a href="/gopl-reflection-1.html">
                        <h2>反射1</h2>
                    </a>
                </header>
                <div class="summary"><p>为什么使用反射；reflect.Type和reflect.Value：Kind方法；递归的值显示器：分析各类型分支，使用示例，循环引用；编码 S表达式：编码方式，编码器实现</p> </div>
                <div class="tags">
                    <ul class="tags">
                        <li><a href="/tag/gopl.html" class="tag">gopl</a></li>
                        <li><a href="/tag/fan-she.html" class="tag">反射</a></li>
                    </ul>
                </div>
                <a href="/gopl-reflection-1.html">
                    <p class="readmore">Read more...</p>
                </a>
            </article>
        </li>
        <li>
            <article>
                <footer>
                        <p>
                        <time datetime="2020-08-12 14:20:00+08:00">
                            <script>document.write(moment('2020-08-12 14:20:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                        ~
                        <time datetime="2020-08-12 14:20:00+08:00">
                            <script>document.write(moment('2020-08-12 14:20:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                                in <a href="/category/go.html"><span class="category-tag">Go</span></a>
                    </p>
                </footer>
                <header>
                    <a href="/gopl-expression-evaluator.html">
                        <h2>表达式求值器</h2>
                    </a>
                </header>
                <div class="summary"><p>定义接口和类型；定义方法；Parse函数：text/scanner包，运算符优先级处理示例；测试函数；check方法；应用到Web服务</p> </div>
                <div class="tags">
                    <ul class="tags">
                        <li><a href="/tag/gopl.html" class="tag">gopl</a></li>
                    </ul>
                </div>
                <a href="/gopl-expression-evaluator.html">
                    <p class="readmore">Read more...</p>
                </a>
            </article>
        </li>
        <li>
            <article>
                <footer>
                        <p>
                        <time datetime="2020-08-11 16:30:00+08:00">
                            <script>document.write(moment('2020-08-11 16:30:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                        ~
                        <time datetime="2020-08-11 16:30:00+08:00">
                            <script>document.write(moment('2020-08-11 16:30:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                                in <a href="/category/go.html"><span class="category-tag">Go</span></a>
                    </p>
                </footer>
                <header>
                    <a href="/gopl-automated-testing.html">
                        <h2>测试</h2>
                    </a>
                </header>
                <div class="summary"><p>功能测试：编写运行测试，基于表的测试，错误消息内容；随机测试；测试命令源码文件；白盒测试：正确使用伪实现；外部测试包：go list工具，白盒测试技巧；好的测试举例；覆盖率；基准测试：查看内存分配，性能比较；性能剖析：获取分析报告；示例函数</p> </div>
                <div class="tags">
                    <ul class="tags">
                        <li><a href="/tag/gopl.html" class="tag">gopl</a></li>
                        <li><a href="/tag/ce-shi.html" class="tag">测试</a></li>
                    </ul>
                </div>
                <a href="/gopl-automated-testing.html">
                    <p class="readmore">Read more...</p>
                </a>
            </article>
        </li>
        <li>
            <article>
                <footer>
                        <p>
                        <time datetime="2020-08-10 15:00:00+08:00">
                            <script>document.write(moment('2020-08-10 15:00:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                        ~
                        <time datetime="2020-08-10 15:00:00+08:00">
                            <script>document.write(moment('2020-08-10 15:00:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                                in <a href="/category/go.html"><span class="category-tag">Go</span></a>
                    </p>
                </footer>
                <header>
                    <a href="/gopl-packages-and-the-go-tool.html">
                        <h2>包和工具</h2>
                    </a>
                </header>
                <div class="summary"><p>空导入；包及成员的命名；go工具：工作空间GOPATH，包的下载(go get)，包的构建(go build, go run)，包的文档化(go doc, godoc)，内部包，包的查询(go list)</p> </div>
                <div class="tags">
                    <ul class="tags">
                        <li><a href="/tag/gopl.html" class="tag">gopl</a></li>
                    </ul>
                </div>
                <a href="/gopl-packages-and-the-go-tool.html">
                    <p class="readmore">Read more...</p>
                </a>
            </article>
        </li>
        <li>
            <article>
                <footer>
                        <p>
                        <time datetime="2020-08-09 10:00:00+08:00">
                            <script>document.write(moment('2020-08-09 10:00:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                        ~
                        <time datetime="2020-08-09 10:00:00+08:00">
                            <script>document.write(moment('2020-08-10 10:00:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                                in <a href="/category/go.html"><span class="category-tag">Go</span></a>
                    </p>
                </footer>
                <header>
                    <a href="/gopl-concurrent-non—blocking-cache.html">
                        <h2>并发非阻塞缓存</h2>
                    </a>
                </header>
                <div class="summary"><p>竞态检测器；并发非阻塞缓存：串行版本，使用互斥锁，重复抑制，另一种实现-使用监控goroutine；小结：CSP并发模型</p> </div>
                <div class="tags">
                    <ul class="tags">
                        <li><a href="/tag/gopl.html" class="tag">gopl</a></li>
                        <li><a href="/tag/sync.html" class="tag">sync</a></li>
                        <li><a href="/tag/ce-shi.html" class="tag">测试</a></li>
                    </ul>
                </div>
                <a href="/gopl-concurrent-non—blocking-cache.html">
                    <p class="readmore">Read more...</p>
                </a>
            </article>
        </li>
        <li>
            <article>
                <footer>
                        <p>
                        <time datetime="2020-08-08 09:30:00+08:00">
                            <script>document.write(moment('2020-08-08 09:30:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                        ~
                        <time datetime="2020-08-08 09:30:00+08:00">
                            <script>document.write(moment('2020-08-10 09:30:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                                in <a href="/category/go.html"><span class="category-tag">Go</span></a>
                    </p>
                </footer>
                <header>
                    <a href="/gopl-share-memory-by-communicating.html">
                        <h2>使用共享变量实现并发</h2>
                    </a>
                </header>
                <div class="summary"><p>竞态；互斥锁；读写互斥锁；内存同步；延迟初始化；goroutine与线程：可增长的栈，goroutine调度，GOMAXPROCS，goroutine没有标识</p> </div>
                <div class="tags">
                    <ul class="tags">
                        <li><a href="/tag/gopl.html" class="tag">gopl</a></li>
                        <li><a href="/tag/sync.html" class="tag">sync</a></li>
                        <li><a href="/tag/goroutine.html" class="tag">goroutine</a></li>
                    </ul>
                </div>
                <a href="/gopl-share-memory-by-communicating.html">
                    <p class="readmore">Read more...</p>
                </a>
            </article>
        </li>
        <li>
            <article>
                <footer>
                        <p>
                        <time datetime="2020-08-07 16:30:00+08:00">
                            <script>document.write(moment('2020-08-07 16:30:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                        ~
                        <time datetime="2020-08-07 16:30:00+08:00">
                            <script>document.write(moment('2020-08-07 16:30:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                                in <a href="/category/go.html"><span class="category-tag">Go</span></a>
                    </p>
                </footer>
                <header>
                    <a href="/gopl-pkg-net-http.html">
                        <h2>Go 函数特性和网络爬虫示例</h2>
                    </a>
                </header>
                <div class="summary"><p>爬取页面；递归：解析HTML，遍历HTML节点数；defer：获取页面的tittle，将页面保存到文件；匿名函数：解析链接，图的遍历；并发的Web爬虫示例：限制并发，程序退出，限制并发的另一个方案，深度限制；取消操作：取消广播，关闭HTTP请求；请求镜像资源</p> </div>
                <div class="tags">
                    <ul class="tags">
                        <li><a href="/tag/gopl.html" class="tag">gopl</a></li>
                        <li><a href="/tag/http.html" class="tag">http</a></li>
                        <li><a href="/tag/pa-chong.html" class="tag">爬虫</a></li>
                    </ul>
                </div>
                <a href="/gopl-pkg-net-http.html">
                    <p class="readmore">Read more...</p>
                </a>
            </article>
        </li>
        <li>
            <article>
                <footer>
                        <p>
                        <time datetime="2020-08-06 15:30:00+08:00">
                            <script>document.write(moment('2020-08-06 15:30:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                        ~
                        <time datetime="2020-08-06 15:30:00+08:00">
                            <script>document.write(moment('2020-08-06 15:30:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                                in <a href="/category/go.html"><span class="category-tag">Go</span></a>
                    </p>
                </footer>
                <header>
                    <a href="/gopl-pkg-net.html">
                        <h2>Go 网络编程示例</h2>
                    </a>
                </header>
                <div class="summary"><p>并发时钟服务器：并发回声服务器；接收完回声再结束；聊天服务器；聊天服务器功能扩展</p> </div>
                <div class="tags">
                    <ul class="tags">
                        <li><a href="/tag/gopl.html" class="tag">gopl</a></li>
                    </ul>
                </div>
                <a href="/gopl-pkg-net.html">
                    <p class="readmore">Read more...</p>
                </a>
            </article>
        </li>
        <li>
            <article>
                <footer>
                        <p>
                        <time datetime="2020-08-05 17:10:00+08:00">
                            <script>document.write(moment('2020-08-05 17:10:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                        ~
                        <time datetime="2020-08-05 17:10:00+08:00">
                            <script>document.write(moment('2020-08-05 17:10:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                                in <a href="/category/go.html"><span class="category-tag">Go</span></a>
                    </p>
                </footer>
                <header>
                    <a href="/gopl-rotoutine-chennle.html">
                        <h2>goroutine 和通道</h2>
                    </a>
                </header>
                <div class="summary"><p>并发编程风格；通道：无缓冲通道，管道，单向通道，缓冲通道，并发请求镜像资源，goroutine泄露；select多路复用：非阻塞模式，通道的零值；示例并发目录遍历：递归遍历目录，计算大小，汇报进度，提高并发效率，限制并发；取消（广播）：发送广播，响应取消</p> </div>
                <div class="tags">
                    <ul class="tags">
                        <li><a href="/tag/gopl.html" class="tag">gopl</a></li>
                    </ul>
                </div>
                <a href="/gopl-rotoutine-chennle.html">
                    <p class="readmore">Read more...</p>
                </a>
            </article>
        </li>
        <li>
            <article>
                <footer>
                        <p>
                        <time datetime="2020-08-04 17:10:00+08:00">
                            <script>document.write(moment('2020-08-04 17:10:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                        ~
                        <time datetime="2020-08-04 17:10:00+08:00">
                            <script>document.write(moment('2020-08-04 17:10:00+08:00').format('YYYY-MM-DD'));</script>
                        </time>
                                in <a href="/category/go.html"><span class="category-tag">Go</span></a>
                    </p>
                </footer>
                <header>
                    <a href="/gopl-adapter-pattern.html">
                        <h2>适配器模式</h2>
                    </a>
                </header>
                <div class="summary"><p>适配器基于OOP方式的实现；Go语言中更轻量级的适配器实现：通过为函数定义方法</p> </div>
                <div class="tags">
                    <ul class="tags">
                        <li><a href="/tag/gopl.html" class="tag">gopl</a></li>
                    </ul>
                </div>
                <a href="/gopl-adapter-pattern.html">
                    <p class="readmore">Read more...</p>
                </a>
            </article>
        </li>
    </ol>
<p class="paginator">
        <a href="/index5.html" class="previous">&laquo;</a>
    <span>
        <a href="/index.html">首页</a>
        &nbsp;6 / 9&nbsp;
        <a href="/index9.html">尾页</a>
    </span>
        <a href="/index7.html" class="next">&raquo;</a>
</p>
</div>                <footer>
                    <div class="icons">
                    </div>
                    <span id="busuanzi_container_page_pv" style="padding: 10px">本文阅读量<span id="busuanzi_value_page_pv"></span>次</span>
                    <span id="busuanzi_container_site_pv" style="padding: 10px">本站总访问量<span id="busuanzi_value_site_pv"></span>次</span>
                    <span id="busuanzi_container_site_uv" style="padding: 10px">本站总访客数<span id="busuanzi_value_site_uv"></span>人</span>
                    <p>© <script>document.write(moment().format('YYYY'));</script> 749B</p>
                </footer>
        </div>
</body>
</html>